﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
namespace StockMatch.WebSite
{
    public class WebConfig
    {
        public static string Resource {
            get {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Resource"])) {
                    throw new Exception("请配置Resource");
                }
                return ConfigurationManager.AppSettings["Resource"];
            }
        }

        /// <summary>
        /// 站点名称
        /// </summary>
        public static string WebSiteName
        {
            get
            {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["WebSiteName"]))
                {
                    throw new Exception("请配置WebSiteName");
                }
                return ConfigurationManager.AppSettings["WebSiteName"];
            }
        }
        /// <summary>
        /// 站点地址
        /// </summary>
        public static string WebSite
        {
            get
            {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["WebSite"]))
                {
                    throw new Exception("请配置WebSite");
                }
                return ConfigurationManager.AppSettings["WebSite"];
            }
        }

        public static string AdminCookieName
        {
            get
            {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["AdminCookieName"]))
                {
                    throw new Exception("请配置AdminCookieName");
                }
                return ConfigurationManager.AppSettings["AdminCookieName"];
            }
        }
        public static string CookieName
        {
            get
            {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["CookieName"]))
                {
                    throw new Exception("请配置CookieName");
                }
                return ConfigurationManager.AppSettings["CookieName"];
            }
        }

        /// <summary>
        /// 文件上传路径
        /// </summary>
        public static string UploadFilePath
        {
            get
            {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["UploadFilePath"]))
                {
                    throw new Exception("请配置UploadFilePath");
                }
                return ConfigurationManager.AppSettings["UploadFilePath"];
            }
        }

        /// <summary>
        /// 短信接口的url
        /// </summary>
        public static string MessageInterfaceUrl
        {
            get
            {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["MessageInterfaceUrl"]))
                {
                    throw new Exception("请配置MessageInterfaceUrl");
                }
                return ConfigurationManager.AppSettings["MessageInterfaceUrl"];
            }
        }
        /// <summary>
        /// 短信接口的用户名
        /// </summary>
        public static string MessageInterfaceUserName
        {
            get
            {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["MessageInterfaceUserName"]))
                {
                    throw new Exception("请配置MessageInterfaceUserName");
                }
                return ConfigurationManager.AppSettings["MessageInterfaceUserName"];
            }
        }
        /// <summary>
        /// 短信接口的密码
        /// </summary>
        public static string MessageInterfaceUserPassword
        {
            get
            {
                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["MessageInterfaceUserPassword"]))
                {
                    throw new Exception("请配置MessageInterfaceUserPassword");
                }
                return ConfigurationManager.AppSettings["MessageInterfaceUserPassword"];
            }
        }
    }
}
